<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>积分详情</title>
		<meta name="Generator" content="EditPlus">
		<meta name="Author" content="">
		<meta name="Keywords" content="">
		<meta name="Description" content="">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
		<link rel="stylesheet" type="text/css" href="css/newmember.css"/>
		<link rel="stylesheet" type="text/css" href="css/style.css" />
		<link rel="shortcut icon" href="img/favicon.ico"/>
		<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="js/luckDraw.js"></script>
		<script type="text/javascript" src="js/newmember.js">
			
		</script>
		<style type="text/css">
			
			.detail{
				width: 100%;
			}                                                     
			.detailTitle{
				width: 1.5rem;
				height: .43rem;
				background: url(img/detail.png)no-repeat;
				background-size: 100% 100%;
				margin: auto;
				margin-top: .35rem;
			}
			.prize{
				width: 100%;
			}
			.prizeTitle{
				width: 1.5rem;
				height: .43rem;
				background: url(img/prize.png)no-repeat;
				background-size: 100% 100%;
				margin: auto;
				margin-top: .35rem;
			}
			table{
				width: 3.5rem;
				margin:.06rem auto;
				margin-top: .26rem;
			}
			thead{
				border:1px solid white;
				background: #a4ceff;
				text-align: center;
				font-size: .14rem;
				font-weight: bold;
				line-height: .3rem;
			}
			thead td{
				width: 33%;
			}
			tbody{
				min-height: .75rem;
				vertical-align: middle;
				text-align: center;
			}
			tbody td{
				padding: .1rem;
				background:#f7f7f7 ;
			}
			.moreD,.moreP{
				width: 3.5rem;
				text-align: center;
				height: .4rem;
				background:#f7f7f7;
				color: gray;
				margin: 0 auto;
				font-size: .15rem;
				line-height: .4rem;
				letter-spacing: .05rem;
				margin-bottom: .2rem;
			}
			
			
			
			
			.button{
				width: 100%;
				height: .9rem;
			}
			.button img{
				width: 100%;
				height: 100%;
			}
		</style>
	</head>
	<body>
		<div class="wrap1">
			<div class="detail">
				<div class="detailTitle">
				</div>
				<table  id="det">
					<thead >
							<td>时间</td>
							<td>动作</td>
							<td>积分</td>
						
					</thead>
					<tbody>
						
					</tbody>
					
				</table>
				<div class="moreD">
					查看更多
				</div>
			</div>
			<div class="prize">
				<div class="prizeTitle">
					
				</div>
				<table id="pri">
					<thead>
						<td>时间</td>
						<td>动作</td>
						<td>积分</td>
					</thead>
					<tbody>
						
					</tbody>
				</table>
				<div class="moreP">
					查看更多
				</div>
			</div>
			<div class="button">
				<img src="img/bottom.png"/>
			</div>
			
		</div>
		
		<script type="text/javascript">
//			var userid = document.URL.split("?")[1].split("&")[0].split("=")[1];
			
			$.ajax({
				url: 'http://test.onetuu.com/Activity/userIntegral', //跨域到http://www.wp.com，另，http://test.com也算跨域
		        type: 'post', //jsonp 类型下只能使用GET,不能用POST,这里不写默认为GET
		        dataType: 'json', //指定为jsonp类型
		        data: { //数据参数
		            "userid": 10
		        },
				success:function(data){
					console.log(data);
					var d="";
					var dd="";
					var p="";
					var pp="";
					if(data.userintegral.length > 0){
						
						for(var i=0;i < 10;i++){
							d += "<tr><td>"+data.userintegral[i].createtime+"</td><td>"+data.userintegral[i].instructions+"</td><td>"+data.userintegral[i].bian+data.userintegral[i].integral+"</td></tr>";
						}
						$("#det tbody").append(d);
						$(".moreD").on("touchend",function(){
							$("#det tbody").empty();
							for(var i=0;i < data.userintegral.length;i++){
								dd += "<tr><td>"+data.userintegral[i].createtime+"</td><td>"+data.userintegral[i].instructions+"</td><td>"+data.userintegral[i].bian+data.userintegral[i].integral+"</td></tr>";
							}
							$("#det tbody").append(dd);
							$(".moreD").hide();
						});
					}else{
						alert("wrong");
					}
					if(data.userwin.length > 0){
						for(var i=0;i < 10;i++){
							p += "<tr><td>"+data.userwin[i].createtime+"</td><td>"+data.userwin[i].iswai+"</td><td>"+data.userwin[i].name+"</td></tr>";
						}
						$("#pri tbody").append(p);
						
						$(".moreP").on("touchend",function(){
							$("#pri tbody").empty();
							for(var i=0;i < data.userwin.length;i++){
								pp += "<tr><td>"+data.userwin[i].createtime+"</td><td>"+data.userwin[i].iswai+"</td><td>"+data.userwin[i].name+"</td></tr>";
							}
							$("#pri tbody").append(pp);
							$(".moreP").hide();
						});
						
					}else{
						alert("wrong");
					}
				}
			});
			
		</script>
	</body>
</html>
